﻿@if (Request.IsAuthenticated) {
   
    <div id ="profile">
        <img src='@Url.Action("getAvatar", "Account")', alt="Notendamynd" class="hidden-phone" />
    

        <div class="btn-group">
         <a class="btn dropdown-toggle btn-large btn-danger" data-toggle="dropdown" href="#" id="user-name">
                @User.Identity.Name 
         <span class="caret"></span>
        </a>
        <ul class="dropdown-menu">
            <li>@Html.ActionLink("Um mig","UserProfile", "Account", new {userName = User.Identity.Name}, null)</li>
            <li>@Html.ActionLink("Stillingar","Manage", "Account", routeValues: null, htmlAttributes: new { id = "AboutMe"})</li>
            <li>@Html.ActionLink("Mínir hópar", "Index", "Group", new { userName = User.Identity.Name }, null)</li> 
                @if (User.IsInRole("Administrator"))
                 {
                    <li>@Html.ActionLink("Kerfisstjóri","Admin", "Account", routeValues: null, htmlAttributes: new { id = "AboutMe"})</li>
                 }
            <li>@Html.ActionLink("Hafa samband","About", "Home", new {userName = User.Identity.Name}, null)</li>
            <li class="divider"></li>
            <li> @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" })) 
                 {
                    @Html.AntiForgeryToken()
                    <a href="javascript:document.getElementById('logoutForm').submit()" id="logout">Útskrá</a>
                 }
           </li>
       </ul>
      </div>

    </div>
      
} else {
     <ul class="freshMeat">
        <li>@Html.ActionLink("Nýskrá", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
        <li>@Html.ActionLink("Skrá inn", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
    </ul>
}